package CSS::Builder::Document;
#
# Mikhail Maluyk
# Fri Dec  5 07:31:14 2008
#
# CSS::Builder::Document - Represents single CSS document object tree
#

use Moose;
use CSS::Builder::Property;

extends qw/CSS::Builder::Base/;
with qw/CSS::Builder::Roles::List/;

has 'name'      => ( isa => 'Str' , is => 'rw' );
has 'file'      => ( isa => 'Str' , is => 'rw' );
has 'overwrite' => ( isa => 'Bool' , is => 'rw' ,  default => 1 );

sub save {
    my $self = shift;
}

sub new_property {
    my $self = shift;
    
    my $property = CSS::Builder::Property->new(@_);
    $self->push($property);
    return $property;
}

sub css {
    my $self = shift;
    
    my $css;
    my $list = $self->list;
    
    for my $property (@$list) {
        $css .= $self->docss($property);
        $css .= "\n";
    }
    
    return $css;
}



1;

__END__

=head1 NAME

CSS::Builder::Document - Represents single CSS document object tree

=head1 SYNOPSIS

    use CSS::Builder::Document;
    my $m = CSS::Builder::Document->new;

=head1 ABSTRACT

=head1 DESCRIPTION

=head1 ACCESSORS

=head2 C<name>

=head2 C<file>

=head2 C<overwrite>

=head1 METHODS

=head2 C<new>

The constructor

=over 4

=item * Arg

Argument

=back

=cut

=head2 C<save>

Function description

=over 4

=item * Arg

Argument

=back

=cut

=head2 C<new_property>

Function description

=over 4

=item * Arg

Argument

=back

=cut

=head2 C<css>

Function description

=over 4

=item * Arg

Argument

=back

=cut

=head1 SEE ALSO

L<Moose> L<CSS::Tutorial>, L<perlpod|Pod::perlpod>, L<perlpodspec|Pod::perlpodspec>

=head1 LICENSE

This software is released under the same terms as perl itself.
If you don't know what that means visit http://perl.com/

=head1 AUTHOR

Copyright (C) Mikhail Maluyk 2008
All rights Reserved

=cut

EOF